home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 569 / gemfst17 / gemfast.h < prev    next >
C/C++ Source or Header  |  1992-06-01  |  17KB  |  482 lines

  1. /* tab expansion/compression should be set to 4 */
  2. /**************************************************************************
  3.  *
  4.  * GEMFAST.H - Header file for common VDI and AES symbols.  
  5.  *
  6.  *  This header file contains items compatible with both GEMDEFS and OBDEFS
  7.  *  from the Alcyon system.  Note that there are no 'extern' definitions
  8.  *  for the GEM functions, because they all return a signed int and work
  9.  *  fine as autodefined functions.
  10.  *
  11.  *  If you have a lot of source already coded for #include <gemdefs.h>,
  12.  *  you can create a dummy (empty) obdefs.h file, and code a new gemdefs.h
  13.  *  file which contains only #include <gemfast.h>.  YOU CAN NO LONGER USE
  14.  *  GEMDEFS AND OBDEFS WITH THE GEMFAST BINDINGS!  For the bindings libs
  15.  *  to work correctly, this header file must be used.  
  16.  *
  17.  * Credits dept:
  18.  *   This file bears an amazing similarity to the original Alcyon GEMDEFS
  19.  *   and OBDEFS header files, which are copyrighted by Atari.  What can I
  20.  *   say?  Copyrighted or not, these are the names and values that every-
  21.  *   body uses, so OF COURSE the files look *awful* similar...
  22.  *
  23.  * Maintenance:
  24.  *  12/03/89 - v1.3
  25.  *             > Renamed a lot of functions, a name compatibility block was
  26.  *               added at the end of this file to smooth the transition.
  27.  *             > Added NO_OBJECT, MU_MENTRY, MU_MEXIT to defines.
  28.  *             > Added XMULTI struct, even though it really belongs to v2.0
  29.  *  05/26/90 - v1.4
  30.  *             > Added RSHDR structure for imbedded resource support.
  31.  *             > Fixed all structures which defined pointers as 'long'...
  32.  *               - ICONBLK ib_pmask, ib_pdata, ib_ptext
  33.  *               - BITBLK  bi_pdata
  34.  *               - USERBLK ub_code
  35.  *               - PARMBLK pb_tree
  36.  *               All of these structure elements now define the proper ptr.
  37.  *             > Added AESUTIL_A, AESFAST_A and VDIFAST_A symbols.  This 
  38.  *               allows specific indication of the presence or abscence of 
  39.  *               the bindings libraries, allowing a programmer to use the
  40.  *               GEMFAST.H header without using the rest of GemFast.  This
  41.  *               also allows conditional compilation code to be more 
  42.  *               specific:  it can now test for the presence of the header
  43.  *               file (and handle the differences in the structure defs),
  44.  *               and it can separately test for the presence of the libs,
  45.  *               and the extended functions available therein.
  46.  *************************************************************************/
  47.  
  48. #ifndef GEMFAST_H               /* Prevent multiple inclusion */
  49.  
  50. #define GEMFAST_H       1       /* Tell the world GEMFAST header is used */
  51. #define GEMF_VERSION    0x0160  /* Tell the world we are v1.60           */
  52.  
  53. #define AESUTIL_A       1       /* Tell the world AESFAST utils  available */
  54. #define AESFAST_A       1       /* Tell the world AESFAST lib is available */
  55. #define VDIFAST_A       1       /* Tell the world VDIFAST lib is available */
  56.  
  57.                                 /* VDI inside fill styles  */
  58. #define IS_HOLLOW   0
  59. #define IS_SOLID    1
  60. #define IS_PATTERN  2
  61. #define IS_HATCH    3
  62. #define IS_UDPTRN   4
  63.                                 /* VDI inside fill patterns  */
  64. #define IP_HOLLOW   0
  65. #define IP_1PTRN    1
  66. #define IP_2PTRN    2
  67. #define IP_3PTRN    3
  68. #define IP_4PTRN    4
  69. #define IP_5PTRN    5
  70. #define IP_6PTRN    6
  71. #define IP_SOLID    7
  72.                                /* VDI normal graphics drawing modes */
  73. #define MD_REPLACE  1
  74. #define MD_TRANS    2
  75. #define MD_XOR      3
  76. #define MD_ERASE    4
  77.                                /* VDI bit blt rules */
  78. #define ALL_WHITE   0
  79. #define S_AND_D     1
  80. #define S_AND_NOTD  2
  81. #define S_ONLY      3
  82. #define NOTS_AND_D  4
  83. #define D_ONLY      5
  84. #define S_XOR_D     6
  85. #define S_OR_D      7
  86. #define NOT_SORD    8
  87. #define NOT_SXORD   9
  88. #define D_INVERT    10
  89. #define NOT_D       10
  90. #define S_OR_NOTD   11
  91. #define NOT_S       12
  92. #define NOTS_OR_D   13
  93. #define NOT_SANDD   14
  94. #define ALL_BLACK   15
  95.                                     /* font types */
  96. #define IBM         3
  97. #define SMALL       5
  98.                                     /* evnt_multi flags */
  99. #define MU_KEYBD    0x0001
  100. #define MU_BUTTON   0x0002
  101. #define MU_M1       0x0004
  102. #define MU_M2       0x0008
  103. #define MU_MESAG    0x0010
  104. #define MU_TIMER    0x0020
  105.                                     /* evnt_mouse flags */
  106. #define MU_MENTRY   0x0000
  107. #define MU_MEXIT    0x0001
  108.                                     /* keyboard states */
  109. #define K_RSHIFT    0x0001
  110. #define K_LSHIFT    0x0002
  111. #define K_CTRL      0x0004
  112. #define K_ALT       0x0008
  113.                                     /* event message values */
  114. #define MN_SELECTED 10
  115. #define WM_REDRAW   20
  116. #define WM_TOPPED   21
  117. #define WM_CLOSED   22
  118. #define WM_FULLED   23
  119. #define WM_ARROWED  24
  120. #define WM_HSLID    25
  121. #define WM_VSLID    26
  122. #define WM_SIZED    27
  123. #define WM_MOVED    28
  124. #define WM_NEWTOP   29
  125. #define AC_OPEN     40
  126. #define AC_CLOSE    41
  127.                                     /* form_dial opcodes */
  128. #define FMD_START   0
  129. #define FMD_GROW    1
  130. #define FMD_SHRINK  2
  131. #define FMD_FINISH  3
  132.                                     /* rsrc_gaddr structure types */
  133. #define ROOT        0               /* this name used by MWC */
  134. #define R_TREE      0 
  135. #define R_OBJECT    1
  136. #define R_TEDINFO   2
  137. #define R_ICONBLK   3
  138. #define R_BITBLK    4
  139. #define R_STRING    5
  140. #define R_IMAGEDATA 6
  141. #define R_OBSPEC    7
  142. #define R_TEPTEXT   8
  143. #define R_TEPTMPLT  9
  144. #define R_TEPVALID  10
  145. #define R_IBPMASK   11 
  146. #define R_IBPDATA   12   
  147. #define R_IBPTEXT   13
  148. #define R_BIPDATA   14
  149. #define R_FRSTR     15
  150. #define R_FRIMG     16 
  151.                                     /* Window Attributes */
  152. #define NAME        0x0001
  153. #define CLOSER      0x0002
  154. #define FULLER      0x0004
  155. #define MOVER       0x0008
  156. #define INFO        0x0010
  157. #define SIZER       0x0020
  158. #define UPARROW     0x0040
  159. #define DNARROW     0x0080
  160. #define VSLIDE      0x0100
  161. #define LFARROW     0x0200
  162. #define RTARROW     0x0400
  163. #define HSLIDE      0x0800
  164.                                     /* wind_calc flags */
  165. #define WC_BORDER   0
  166. #define WC_WORK     1
  167.                                     /* wind_get flags */
  168. #define WF_KIND     1
  169. #define WF_NAME     2
  170. #define WF_INFO     3
  171. #define WF_WORKXYWH 4
  172. #define WF_CURRXYWH 5
  173. #define WF_PREVXYWH 6
  174. #define WF_FULLXYWH 7
  175. #define WF_HSLIDE   8
  176. #define WF_VSLIDE   9
  177. #define WF_TOP      10
  178. #define WF_FIRSTXYWH 11
  179. #define WF_NEXTXYWH 12
  180. #define WF_RESVD    13
  181. #define WF_NEWDESK  14
  182. #define WF_HSLSIZE  15
  183. #define WF_VSLSIZE  16
  184. #define WF_SCREEN   17
  185.                                     /* wind_update flags */
  186. #define END_UPDATE  0
  187. #define BEG_UPDATE  1
  188. #define END_MCTRL   2
  189. #define BEG_MCTRL   3
  190.                                     /* graf_mouse mouse types*/
  191. #define ARROW       0
  192. #define TEXT_CRSR   1
  193. #define HOURGLASS   2               /* this name used by MWC (why?) */
  194. #define BUSY_BEE    2
  195. #define BEE         2
  196. #define POINT_HAND  3
  197. #define FLAT_HAND   4
  198. #define THIN_CROSS  5
  199. #define THICK_CROSS 6
  200. #define OUTLN_CROSS 7
  201. #define USER_DEF    255
  202. #define M_OFF       256
  203. #define M_ON        257
  204.                                 /* max depth of search or draw  */
  205. #define MAX_DEPTH   8
  206.                                 /* value returned by objc_find(), et. al. */
  207. #define NO_OBJECT   -1
  208.                                 /* object types */
  209. #define G_BOX       20
  210. #define G_TEXT      21
  211. #define G_BOXTEXT   22
  212. #define G_IMAGE     23
  213. #define G_USERDEF   24
  214. #define G_PROGDEF   24
  215. #define G_IBOX      25
  216. #define G_BUTTON    26
  217. #define G_BOXCHAR   27
  218. #define G_STRING    28
  219. #define G_FTEXT     29
  220. #define G_FBOXTEXT  30
  221. #define G_ICON      31
  222. #define G_TITLE     32
  223.                                 /* object flags */
  224. #define NONE        0x0000
  225. #define SELECTABLE  0x0001
  226. #define DEFAULT     0x0002
  227. #define EXIT        0x0004
  228. #define EDITABLE    0x0008
  229. #define RBUTTON     0x0010
  230. #define LASTOB      0x0020
  231. #define TOUCHEXIT   0x0040
  232. #define HIDETREE    0x0080
  233. #define INDIRECT    0x0100
  234.                                 /* Object states */
  235. #define NORMAL      0x0000
  236. #define SELECTED    0x0001
  237. #define CROSSED     0x0002
  238. #define CHECKED     0x0004
  239. #define DISABLED    0x0008
  240. #define OUTLINED    0x0010
  241. #define SHADOWED    0x0020
  242.                                 /* Object colors    */
  243. #define WHITE       0
  244. #define BLACK       1
  245. #define RED         2
  246. #define GREEN       3
  247. #define BLUE        4
  248. #define CYAN        5
  249. #define YELLOW      6
  250. #define MAGENTA     7
  251. #define LWHITE      8
  252. #define LBLACK      9
  253. #define LRED        10
  254. #define LGREEN      11
  255. #define LBLUE       12
  256. #define LCYAN       13
  257. #define LYELLOW     14
  258. #define LMAGENTA    15
  259.                                 /* editable text field definitions */
  260. #define EDSTART     0
  261. #define EDINIT      1
  262. #define EDCHAR      2
  263. #define EDEND       3
  264.                                 /* editable text justification */
  265. #define TE_LEFT     0
  266. #define TE_RIGHT    1
  267. #define TE_CNTR     2
  268.  
  269.                                 /* VDI Memory Form Definition Block */
  270.                              
  271. #ifndef FDADDR                  /* v1.3:  this typedef has been added to */
  272. typedef char *FDADDR;           /* help provide compatibility between    */
  273. #endif                          /* bindings systems.                     */
  274.  
  275. typedef struct fdbstr {
  276.     FDADDR  fd_addr;
  277.     int     fd_w;
  278.     int     fd_h;
  279.     int     fd_wdwidth;
  280.     int     fd_stand;
  281.     int     fd_nplanes;
  282.     int     fd_r1;
  283.     int     fd_r2;
  284.     int     fd_r3;
  285.     } FDB;    
  286.  
  287. #define MFDB    FDB                 /* MFDB added for Laser compatibily */
  288.  
  289.                                     /* Mouse Form Definition Block */
  290. typedef struct mfstr {
  291.     int mf_xhot;
  292.     int mf_yhot;
  293.     int mf_nplanes;
  294.     int mf_fg;
  295.     int mf_bg;
  296.     int mf_mask[16];
  297.     int mf_data[16];
  298.     } MFORM ;
  299.  
  300. typedef struct object {
  301.     int             ob_next;        /* -> object's next sibling     */
  302.     int             ob_head;        /* -> head of object's children */
  303.     int             ob_tail;        /* -> tail of object's children */
  304.     unsigned int    ob_type;        /* type of object               */
  305.     unsigned int    ob_flags;       /* flags                        */
  306.     unsigned int    ob_state;       /* state                        */
  307.     long            ob_spec;        /* whatever...                  */
  308.     int             ob_x;           /* upper left corner of object  */
  309.     int             ob_y;           /* upper left corner of object  */
  310.     int             ob_width;       /* width of obj                 */
  311.     int             ob_height;      /* height of obj                */
  312.     } OBJECT;
  313.  
  314. typedef struct grect {
  315.     int g_x;
  316.     int g_y;
  317.     int g_w;
  318.     int g_h;
  319.     } GRECT;
  320.  
  321. typedef struct vrect {
  322.     int v_x1;
  323.     int v_y1;
  324.     int v_x2;
  325.     int v_y2;
  326.     } VRECT;
  327.  
  328. typedef struct text_edinfo {
  329.     char *te_ptext;             /* ptr to text               */
  330.     char *te_ptmplt;            /* ptr to template           */
  331.     char *te_pvalid;            /* ptr to validation chrs.   */
  332.     int  te_font;               /* font                      */
  333.     int  te_junk1;              /* junk word                 */
  334.     int  te_just;               /* justification             */
  335.     int  te_color;              /* color information word    */
  336.     int  te_junk2;              /* junk word                 */
  337.     int  te_thickness;          /* border thickness          */
  338.     int  te_txtlen;             /* length of text string     */
  339.     int  te_tmplen;             /* length of template string */
  340.     } TEDINFO;
  341.  
  342. typedef struct icon_block {
  343.     int  *ib_pmask;
  344.     int  *ib_pdata;
  345.     char *ib_ptext;
  346.     int  ib_char;
  347.     int  ib_xchar;
  348.     int  ib_ychar;
  349.     int  ib_xicon;
  350.     int  ib_yicon;
  351.     int  ib_wicon;
  352.     int  ib_hicon;
  353.     int  ib_xtext;
  354.     int  ib_ytext;
  355.     int  ib_wtext;
  356.     int  ib_htext;
  357.     } ICONBLK;
  358.  
  359. typedef struct bit_block {
  360.     int  *bi_pdata;                 /* ptr to bit forms data  */
  361.     int  bi_wb;                     /* width of form in bytes */
  362.     int  bi_hl;                     /* height in lines        */
  363.     int  bi_x;                      /* source x in bit form   */
  364.     int  bi_y;                      /* source y in bit form   */
  365.     int  bi_color;                  /* fg color of blt        */
  366.     } BITBLK;
  367.  
  368. typedef struct user_blk {
  369.     long (*ub_code)();
  370.     long ub_parm;
  371.     } USERBLK;
  372.  
  373. #define appl_blk user_blk
  374. #define APPLBLK  USERBLK
  375.  
  376. typedef struct parm_blk {
  377.     OBJECT  *pb_tree;
  378.     int     pb_obj;
  379.     int     pb_prevstate;
  380.     int     pb_currstate;
  381.     int     pb_x,  pb_y,  pb_w,  pb_h;
  382.     int     pb_xc, pb_yc, pb_wc, pb_hc;
  383.     long    pb_parm;
  384.     } PARMBLK;
  385.  
  386. /*-------------------------------------------------------------------------
  387.  * RSHDR structure...
  388.  *-----------------------------------------------------------------------*/
  389.  
  390. typedef struct rshdr {                                                   
  391.         int             rsh_vrsn;       /* Resource structure version # */
  392.         unsigned int    rsh_object;     /* Offset to first object       */
  393.         unsigned int    rsh_tedinfo;    /* Offset to first tedinfo      */
  394.         unsigned int    rsh_iconblk;    /* Offset to first iconblk      */
  395.         unsigned int    rsh_bitblk;     /* Offset to first bitblk       */
  396.         unsigned int    rsh_frstr;      /* Offset to free string index  */
  397.         unsigned int    rsh_string;     /* Offset to string data        */
  398.         unsigned int    rsh_imdata;     /* Offset to image data         */
  399.         unsigned int    rsh_frimg;      /* Offset to free image index   */
  400.         unsigned int    rsh_trindex;    /* Offset to tree index         */
  401.         unsigned int    rsh_nobs;       /* Number of objects            */
  402.         unsigned int    rsh_ntree;      /* Number object trees          */
  403.         unsigned int    rsh_nted;       /* Number of tedinfo structs    */
  404.         unsigned int    rsh_nib;        /* Number of iconblk structs    */
  405.         unsigned int    rsh_nbb;        /* Number of bitblk structs     */
  406.         unsigned int    rsh_nstring;    /* Number of free strings       */
  407.         unsigned int    rsh_nimages;    /* Number of free images        */
  408.         unsigned int    rsh_rssize;     /* total bytes in resource      */
  409.     } RSHDR;
  410.  
  411. #define RSHDR_DEFINED 1 /* signal to other header files that RSHDR is done */
  412.  
  413. typedef struct xmouse {
  414.     int retval;
  415.     int bclicks;
  416.     int mask;
  417.     int state;
  418.     int status;
  419.     int mousex;
  420.     int mousey;
  421.     int mouseb;
  422.     int keystate;
  423.     } XMOUSE;
  424.  
  425. typedef struct xmulti {
  426.     int     msgbuf[8];
  427.     int     mflags,
  428.             mbclicks,
  429.             mbmask,
  430.             mbstate,
  431.             mm1flags;
  432.     GRECT   mm1rect;
  433.     int     mm2flags;
  434.     GRECT   mm2rect;
  435.     int     mtlocount,
  436.             mthicount;
  437.     int     mwhich,
  438.             mmox,
  439.             mmoy,
  440.             mmobutton,
  441.             mmokstate,
  442.             mkreturn,
  443.             mbreturn;
  444. } XMULTI;
  445.  
  446. /**************************************************************************
  447.  *
  448.  * Name compatibility stuff.
  449.  *
  450.  *  05/26/90 - v1.4
  451.  *              Added mapping of find_exttype to obj_xtfind.
  452.  *  08/28/89 - v1.3
  453.  *              In v1.3, a big push has been made to make a consistant
  454.  *              naming standard for the AES utilities.  To avoid breaking
  455.  *              a lot of existing code, the following block will direct
  456.  *              the old names to the new routines.
  457.  *
  458.  *************************************************************************/
  459.  
  460. #define objclg_adjust           rc_gadjust
  461. #define objclv_adjust           rc_vadjust
  462.  
  463. #define objrb_which(a,b)        obj_rbfind((a),(b),SELECTED)
  464. #define obj_rbwhich(a,b)        obj_rbfind((a),(b),SELECTED)
  465. #define objxrb_which            obj_rbfind
  466.  
  467. #define objc_xywh               obj_xywh
  468.  
  469. #define find_exttype            obj_xtfind
  470.  
  471. #define objst_change            obj_stchange
  472. #define objfl_change            obj_flchange
  473.  
  474. #define graqon_mouse            gra_qonmouse
  475. #define graqof_mouse            gra_qofmouse
  476. #define graq_mstate             gra_qmstate
  477.  
  478. #endif
  479.  
  480. /*  end of GEMFAST.H */
  481.  
  482.